package com.scrawler.html.template;



import org.htmlparser.NodeFilter;
import org.htmlparser.filters.AndFilter;
import org.htmlparser.filters.HasAttributeFilter;
import org.htmlparser.filters.TagNameFilter;


public class TestCrawlArticleContent {
	
	private static CrawlArticleContentBase base = new CrawlArticleContentBase();
	private static CrawlTiebaContentBase tieba = new CrawlTiebaContentBase();
	
	// sina article.
	private static  NodeFilter filters[] = new NodeFilter[]{
			new HasAttributeFilter("id","artibodyTitle"),
			new HasAttributeFilter("id","artibody"),
			new HasAttributeFilter("class","artInfo"),
			new  HasAttributeFilter("class","J_Comment_Count_Txt fgrey333")
	};		
	
	private static  NodeFilter tiebaTopicFilter[] = new NodeFilter[]{
		// new HasAttributeFilter("class","threadlist_li_right j_threadlist_li_right"),
		 new HasAttributeFilter("class","pager clearfix"),								//主题列表分页
		 new HasAttributeFilter("title","主题作者"),										// 主题作者
		 new HasAttributeFilter("class","threadlist_reply_date j_reply_data"),	// 最后回复时间
		 new AndFilter(new NodeFilter[]{													// 帖子主题
			new TagNameFilter("a"),
			new HasAttributeFilter("class","j_th_tit")
		})
		};		
	
	//
	
	private static  NodeFilter tiebaDetailFilter[] = new NodeFilter[]{
		// new HasAttributeFilter("class","l_pager pager_theme_3"),					//主题列表分页
		// new HasAttributeFilter("class","p_author_name"),								// 回帖人
		 new HasAttributeFilter("class","p_tail")											// 回复时间
		// new HasAttributeFilter("class","d_post_content j_d_post_content"),	//回复内容
		};		
	
	
	
	public static  void test(){

		tieba.getFiledValueByUrl("http://tieba.baidu.com/p/2398118845", tiebaDetailFilter);
		
		
		
		
	}
	
	
	
	public static void main(String args[]){
		test();
	}
	
}
